<?php
/**
 * 输出的接口异常
 */

namespace App\Exceptions\v1;

/**
 * 基类
 *
 * Class BaseException
 * @package App\Exceptions\v1
 */
abstract class BaseException extends \Exception
{
    protected $httpStatus;

    protected $externalMessage;

    public function __construct(string $message = "", int $code = 0, 
                                string $externalMessage = null, \Throwable $previous = null)
    {
        parent::__construct($message, $code, $previous);

        $this->externalMessage = $externalMessage;
    }

    public function getHttpStatus()
    {
        return $this->httpStatus;
    }

    public function getExternalMessage()
    {
        return $this->externalMessage;
    }
}
